@extends('admin._layouts.default')

@section('main')


      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3><a href="complain_all.html"  class="btn btn-info btn-mini pull-right mg5">查看全部</a>
                  <i class="fa fa-headphones"></i> 客诉管理
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content min_h500">

            <table id="datatable_in" class="responsive table table-striped" style="width:100%;margin-bottom:0; ">
              <thead>
               <tr>
                 <th width="80">
                   头像
                  </th>
                  <th width="80">
                    <i class="fa fa-wechat"></i> 昵称
                  </th>
                  <th width="120">
                    联系方式
                  </th>
                  <th width="120">
                   所在城市
                  </th>
                 <th>
                   当前投诉内容
                 </th>
                 <th width="160">
                   操作
                 </th>
               </tr>
              </thead>
              <tbody>
              @foreach($rates as $rate)
               <tr>
                  <td>
                   <img class="thumbnail small" src="{{ $rate->customer->avatar}}">
                  </td>
                 <td>
                    {{ $rate->customer->name}}
                  </td>
                  <td>
                  @if($rate->service_id == 0)
                    <i class="fa fa-user"></i> {{ $rate->mount->mount_name}} @if($rate->mount->sex == 1) 先生 @else 女士 @endif<br/> <i class="fa fa-mobile"></i> {{ $rate->mount->mount_mobile}}
                    @else
                    <i class="fa fa-user"></i> {{ $rate->Service->mount->mount_name}} @if($rate->Service->mount->sex == 1) 先生 @else 女士 @endif<br/> <i class="fa fa-mobile"></i> {{ $rate->Service->mount->mount_mobile}}
                    @endif
                 </td>
                 <td>
                    <i class="fa fa-map-marker"></i> {{ $rate->customer->provincename->name}} {{ $rate->customer->cityname->name}}
                 </td>
                 <td>
                  <span class="color_orange"><i class="fa fa-thumbs-o-up"></i>
                    @if($rate->type == 0)
                        @if($rate->form1 >3)
                        好评
                        @elseif($rate->form1 < 1)
                        差评
                        @else
                        中评
                        @endif
                    @else
                        投诉与建议
                    @endif
                  </span><br />
                    <i class="fa fa-quote-left"></i> {{ $rate->remark }}
                 </td>
                 <td>
                      <a class="btn btn-small" onclick="set_id('{{ $rate->id }}');" rel="tooltip" data-placement="left" data-original-title="重新派单处理" data-toggle="modal" data-target="#work_out"><i class="fa fa-bicycle"></i></a>
                 </td>
                 {{--<td>--}}
                    {{--<div class="btn-group1">--}}
                      {{--<a class="btn btn-small" rel="tooltip" data-placement="left" data-original-title="请总部处理" data-toggle="modal" data-target="#confirm_alert"><i class="fa  fa-fire-extinguisher"></i></a>--}}
                     {{--<a class="btn btn-inverse btn-small" rel="tooltip" data-placement="bottom" data-original-title="立即处理"  href="complain_dispose.html"><i class="gicon-edit icon-white"></i></a>--}}
                   {{--</div>--}}
                 {{--</td>--}}
               </tr>
               @endforeach

               </tbody>
            </table>
                <div class="row-fluid control-group">

                    <div class="pagination pull-right ">
                    {{ $rates->links() }}
                    </div>
                </div>
                <br/>


            </div>
        </div>
        <!-- End box -->
      </div>


@stop


@section('modals')

<div id="confirm_alert" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 class="modal-title" id="myModalLabel">确定本次操作吗？</h3>
      </div>
      <div class="modal-body">
        <i class=" icon-warning-sign color_red pull-left fs_24"></i>

        <p>一旦【确定】，本次操作不可撤销。</p>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary">确定</button>
      </div>
    </div>
  </div>
</div>

<div id="work_out" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 class="modal-title" id="myModalLabel">员工列表</h3>
      </div>
      <div class="modal-body">
          {{--<div class="form-row control-group row-fluid">--}}
            {{--<div class="controls span9">--}}
              {{--<div class="input-append row-fluid">--}}
                {{--<input type="text" class="span5" id="search-input" placeholder="搜索员工">--}}
                {{--<button type="submit" class="btn">搜索</button>--}}
              {{--</div>--}}
            {{--</div>--}}
          {{--</div>--}}

            {{ Form::open(array('route' => 'admin.services.paidan','id'=>'works','class'=>'form-horizontal')) }}
          <input type="hidden" name="service_id" value="" id="service_id">
          <input type="hidden" name="paidan_type" value="re">
          <table class="table">
            <thead>
            <tr>
              <th width="60">
                选择
              </th>
              <th width="80">
                头像
              </th>
              <th>
                姓名
              </th>
            </tr>
            </thead>
            <tbody>
            @foreach($works as $work)
            <tr>
              <td>
                <input type="radio" name="radio" value="{{ $work->id }}" />
              </td>
              <td>
               <img class="thumbnail small" src="{{ $work->avatar }}">
              </td>
              <td>
                {{ $work->name }}
              </td>
            </tr>
            @endforeach

            </tbody>
          </table>
        {{ Form::close() }}

      </div>
      <div class="modal-footer">
                <div class="row-fluid control-group">
                  <div class="pull-left span6" action="#">
                    <div class="pagination pull-left ">
                    </div>
                  </div>
                  <div class="span6">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" onclick="sub_paidan();" class="btn btn-primary">确定</button>
                  </div>
                </div>


      </div>
    </div>
  </div>
</div>
@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/full-calendar/fullcalendar.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/jquery.peity.min.js') }}"></script>
<script type="text/javascript" language="javascript" src="{{ URL::asset('ad/js/plugins/datatables/js/jquery.dataTables.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/flot/jquery.flot.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('ad/js/plugins/jquery.uniform.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/plugins/justGage.1.0.1/resources/js/raphael.2.1.0.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/plugins/justGage.1.0.1/resources/js/justgage.1.0.1.min.js') }}"></script>
<script src="{{ URL::asset('ad/js/scripts.js') }}"></script>


    <script type="text/javascript" charset="utf-8">
    // Datatables
    $(document).ready(function() {
      var dontSort = [];
                $('#datatable_city thead th').each( function () {
                    if ( $(this).hasClass( 'no_sort' )) {
                        dontSort.push( { "bSortable": false } );
                    } else {
                        dontSort.push( null );
                    }
      } );
      $('#datatable_city').dataTable( {
        "sDom": "<'row table_top_bar'<'row-fluid'>'<'to_hide_phone'>'f'<'>r>t<'row'>",
         "sDom": "<'row table_top_bar'<'row-fluid'<'to_hide_phone' f>>><'row'>",
         "aaSorting": [[ 1, "asc" ]],
        "bPaginate": false,
        "bJQueryUI": false,
        "aoColumns": dontSort

      } );
      $.extend( $.fn.dataTableExt.oStdClasses, {
        "s`": "dataTables_wrapper form-inline"
      } );
    } );
    </script>
    <script>
    function set_id(id){
        $('#service_id').val(id);
    }
    function sub_paidan(){
        $('#works').submit();

    }
    </script>
@stop
